package com.erlang4j.api.exceptions;

import java.util.Stack;

import com.erlang4j.internal.exceptions.Erlang4jException;
import com.erlang4j.internal.exceptions.Erlang4jExceptionConstants;
import com.erlang4j.internal.messages.MessageTokenType;

/**
 * <p>
 * This exception occurs when we run out of tokens when parsing.
 * </p>
 * <p>
 * Examples that cause this are "{atom" and "[{atom}"
 * </p>
 * 
 * @author Phil Rice
 */
public class Erlang4jUnexpectedEndOfTokens extends Erlang4jException {

	private final Stack<MessageTokenType> expected;

	public Erlang4jUnexpectedEndOfTokens(String input, Stack<MessageTokenType> expected) {
		super(Erlang4jExceptionConstants.unexpectedEndOfTokensKey, input, expected);
		this.expected = expected;
	}

	public Stack<MessageTokenType> getExpected() {
		return expected;
	}

}
